var CreateDiv=function(html){
   this.html=html;
   this.init();
}
CreateDiv.prototype.init=function(){
    var div =document.createElement("div");
    div.innerHTML=this.html;
    document.body.appendChild(div);
}
//接下来引入代理类proxySingletonCreateDiv：
var proxySingletonCreateDiv=(function(){
    var instance;  //定义一个变量
    return function(html){    //返回函数
        if(!instance){         //如果不是instance就创建一个 新的instance
            instance=new CreateDiv(html)
        }
        return instance;      //将新创建的instance返回出去
    }
})();
var a = new ProxySingletonCreateDiv( 'sven1' );
var b = new ProxySingletonCreateDiv( 'sven2' );
alert ( a === b );